import React from 'react';
import { inject, observer } from 'mobx-react';
import {WeaDialog,WeaNewScroll} from "ecCom"
import {Button} from "antd"
import {WeaTableNew,WeaSwitch} from 'comsMobx';
const WeaTable = WeaTableNew.WeaTable;
import CptFlowLog from './cptFlowLog'
import CptModify from "./cptModify"
import {WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;

@observer
export default class CptRecordDialog extends React.Component{
    componentWillReceiveProps(nextProps){
      
    }
    shouldComponentUpdate(){
        return true;
    }
    render(){
        const {visible,type,contentStore} = this.props;
        const {showCptFlowModify} = contentStore;
        const title = type == "flow" ? getLabel(34253,"流转日志"):getLabel(19765,"变更记录");
        return (
            <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@j4p01d`}
                title={title}
                visible={visible}
                buttons={this.getBottomButtons()}
                icon="icon-coms-fa"
                iconBgcolor="#f14a2d"
                onCancel={()=>{showCptFlowModify(false)}}
                style={{width:1000,height:600}}
            >
                    <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@2e5zla`} height={"100%"}>
                    {
                        type == "flow" && 
                        <CptFlowLog ecId={`${this && this.props && this.props.ecId || ''}_CptFlowLog@2lx4s6`}  contentStore={contentStore} />
                    }
                     {
                        type == "modify" && 
                        <CptModify ecId={`${this && this.props && this.props.ecId || ''}_CptModify@41ijoe`}   contentStore={contentStore} />
                    }
                    </WeaNewScroll>
            </WeaDialog>
        )
    }
    getBottomButtons(){
        const {showCptFlowModify} = this.props.contentStore;
        let btnArr = []; 
        btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@kuevl7@close`}  type="primary" onClick={()=>{
            showCptFlowModify(false)
        }}>{getLabel(309,'关闭')}</Button>)  
        return btnArr;
    }
   
}